<template>
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:order:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:order:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:order:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:order:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="工单号" align="center" prop="gdCode" />
      <el-table-column label="优先级" align="center" prop="gdGoodlevel" :formatter="gdLevel"/>
      <el-table-column label="工单状态" align="center" prop="gdStatus" :formatter="gdStatus"/>
      <el-table-column label="工单进度" align="center" prop="">
        <template slot-scope="scope">
          <el-progress type="line" :percentage="Math.round((scope.row.wcNum / scope.row.workNum) * 100)"  color="#57DCDD" :text-inside="false" :stroke-width="12" />
        </template>
      </el-table-column>
      <el-table-column label="负责人" align="center" prop="responsibility" />
      <el-table-column label="订单号" align="center" prop="ddCode" />
      <el-table-column label="产品批次" align="center" prop="cpCppcCode" />
      <el-table-column label="产品编码" align="center" prop="cpCode" />
      <el-table-column label="产品名称" align="center" prop="cpProduct.cpName" />
      <el-table-column label="产品型号" align="center" prop="cpProduct.cpType" />
      <el-table-column label="任务数量" align="center" prop="workNum"/>
      <el-table-column label="完成数量" align="center" prop="wcNum"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:order:edit']"
          >详情</el-button>

          <!-- 如果状态是未投产 (2) -->
          <el-button
            v-if="scope.row.gdStatus == '2'"
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="updateGdNoStatus(scope.row,'投产')"
            v-hasPermi="['system:order:edit']"
          >投产</el-button>

          <!-- 如果状态是已投产 (3)  -->
          <el-button
            v-if="scope.row.gdStatus == '3'"
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="updateGdNoStatus(scope.row,'撤回')"
            v-hasPermi="['system:order:edit']"
          >撤回</el-button>

          <!-- 编辑按钮 -->
          <el-button
            v-if="scope.row.gdStatus == '2'"
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdates(scope.row)"
            v-hasPermi="['system:order:edit']"
          >编辑</el-button>

          <!-- 删除按钮 -->
          <el-button
            v-if="scope.row.gdStatus == '2'"
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:order:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改生产工单对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
      <div class="qyhH">
      <el-form ref="form" :model="form" :rules="rules" label-width="100px" :inline="true" style="font-size: 10px">
        <el-form-item label="工单优先级" prop="gdGoodlevel">
          <el-select v-model="form.gdGoodlevel" placeholder="请选择">
            <el-option label="一级" value="1"></el-option>
            <el-option label="二级" value="2"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="订单号" prop="scddProductionOrderForm.ddCode" readonly>
          <el-input v-model="form.scddProductionOrderForm.ddCode" placeholder="请选择" readonly @click.native="getScdd" suffix-icon="el-icon-more"/>
        </el-form-item>
        <el-form-item label="工单客户" prop="scddProductionOrderForm.ksMerchant.merchantsName" readonly>
          <el-input v-model="form.scddProductionOrderForm.ksMerchant.merchantsName" readonly/>
        </el-form-item>
        <el-form-item label="合同编号" prop="scddProductionOrderForm.htCode">
          <el-input v-model="form.scddProductionOrderForm.htCode" readonly/>
        </el-form-item>
        <el-form-item label="产品名称" prop="scddProductionOrderForm.cpProduct.cpName">
          <el-input v-model="form.scddProductionOrderForm.cpProduct.cpName" readonly/>
        </el-form-item>
        <el-form-item label="产品编码" prop="scddProductionOrderForm.cpCode">
          <el-input v-model="form.scddProductionOrderForm.cpCode" readonly/>
        </el-form-item>
        <el-form-item label="产品型号" prop="scddProductionOrderForm.cpProduct.cpType" readonly>
          <el-input v-model="form.scddProductionOrderForm.cpProduct.cpType" readonly/>
        </el-form-item>
        <el-form-item label="负责人" prop="responsibility">
          <el-input v-model="form.responsibility" readonly @click.native="getUsers" suffix-icon="el-icon-more"/>
        </el-form-item>
        <el-form-item label="任务数量" prop="workNum">
          <el-input v-model="form.workNum"/>
        </el-form-item>
        <el-form-item label="交货日期" prop="jhTime">
          <el-date-picker clearable v-model="form.jhTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择"/>
        </el-form-item>
        <el-form-item label="开始时间" prop="startTime">
          <el-date-picker clearable v-model="form.startTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择"/>
        </el-form-item>
        <el-form-item label="完成时间" prop="endTime">
          <el-date-picker clearable v-model="form.endTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择"/>
        </el-form-item>
        <el-form-item label="备注" prop="other">
          <el-input type="textarea" v-model="form.other" placeholder="请输入备注" id="other"/>
        </el-form-item>

      </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!--工单详情-->
    <el-dialog :title="scgdTitle" :visible.sync="scgdSelected" width="600px" append-to-body>
      <div class="dialog-content">
        <el-form ref="form" :model="form" label-width="120px" style="font-size: 10px">
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="工单优先级：" prop="gdGoodlevel">
                <span>{{ form.gdGoodlevel }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="订单号：" prop="scddProductionOrderForm.ddCode">
                <span>{{ form.scddProductionOrderForm.ddCode }}</span>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="工单客户：" prop="scddProductionOrderForm.ksMerchant.merchantsName">
                <span>{{ form.scddProductionOrderForm.ksMerchant.merchantsName }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="合同编号：" prop="scddProductionOrderForm.htCode">
                <span>{{ form.scddProductionOrderForm.htCode }}</span>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="产品名称：" prop="scddProductionOrderForm.cpProduct.cpName">
                <span>{{ form.scddProductionOrderForm.cpProduct.cpName }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="产品编码：" prop="scddProductionOrderForm.cpCode">
                <span>{{ form.scddProductionOrderForm.cpCode }}</span>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="产品型号：" prop="scddProductionOrderForm.cpProduct.cpType">
                <span>{{ form.scddProductionOrderForm.cpProduct.cpType }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="负责人：" prop="responsibility">
                <span>{{ form.responsibility }}</span>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="任务数量：" prop="workNum">
                <span>{{ form.workNum }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="交货日期：" prop="jhDate">
                <span>{{ form.jhTime }}</span>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="12">
              <el-form-item label="开始时间：" prop="startTime">
                <span>{{ form.startTime }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="完成时间：" prop="finishTime">
                <span>{{ form.endTime }}</span>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="24">
              <el-form-item label="备注：" prop="other">
                <span>{{ form.other }}</span>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>


        <!-- 标签页部分 -->
        <el-tabs v-model="activeTab">
          <el-tab-pane label="生产BOM" name="bom">
            <el-table :data="bomData" style="width: 100%">
              <el-table-column prop="wlName" label="物料名称" show-overflow-tooltip></el-table-column>
              <el-table-column prop="wlCode" label="物料编码" show-overflow-tooltip></el-table-column>
              <el-table-column prop="wlTypecode" label="物料类型" show-overflow-tooltip>
                <template slot-scope="scope">
                  <dict-tag :options="dict.type.wl_type" :value="scope.row.wlTypecode"/>
                </template>
              </el-table-column>
              <el-table-column prop="wlGg" label="物料规格" show-overflow-tooltip></el-table-column>
              <el-table-column prop="jldwMeasurementUnit.dwName" label="物料单位" show-overflow-tooltip></el-table-column>
              <el-table-column prop="wlFormcode" label="物料来源" show-overflow-tooltip>
                <template slot-scope="scope">
                  <dict-tag :options="dict.type.wl_from" :value="scope.row.wlFormcode"/>
                </template>
              </el-table-column>
              <el-table-column prop="wlMaterialsAndMesBom.many" label="基本用量" show-overflow-tooltip></el-table-column>
            </el-table>
          </el-tab-pane>

          <el-tab-pane label="产品属性" name="attributes">
            <!-- 产品属性内容 -->
            <el-table :data="attributesData" style="width: 100%">
              <el-table-column prop="sxName" label="属性名称"></el-table-column>
              <el-table-column prop="sxValue" label="属性值"></el-table-column>
            </el-table>
          </el-tab-pane>

        </el-tabs>

<!--        &lt;!&ndash; 工序生产进度表格 &ndash;&gt;-->
<!--        <el-table :data="productionProgressData" style="width: 100%; margin-top: 20px;">-->
<!--          <el-table-column prop="序号" label="序号" width="50"></el-table-column>-->
<!--          <el-table-column prop="工序名称" label="工序名称"></el-table-column>-->
<!--          <el-table-column prop="工序类型" label="工序类型"></el-table-column>-->
<!--          <el-table-column prop="生产位置" label="生产位置"></el-table-column>-->
<!--          <el-table-column prop="生产人员" label="生产人员"></el-table-column>-->
<!--          <el-table-column prop="生产进度" label="生产进度">-->
<!--            <template slot-scope="scope">-->
<!--              <el-progress :text-inside="true" :stroke-width="18" :percentage="scope.row.生产进度"></el-progress>-->
<!--            </template>-->
<!--          </el-table-column>-->
<!--        </el-table>-->
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="scgdBtn">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 生产订单弹框 -->
    <el-dialog title="选择订单" :visible.sync="ddSelect" width="30%">
      <el-container>
        <el-main>
          <!-- 展示订单信息 -->
          <el-table border :data="scddList" @row-dblclick="updateScdd">
            <el-table-column prop="ddCode" label="订单号" width="140px"></el-table-column>
            <el-table-column prop="ddTypecode" label="订单类型" :formatter="orderType"></el-table-column>
            <el-table-column prop="ddGoodcode" label="订单性质" :formatter="orderAbility"></el-table-column>
            <el-table-column prop="cpProduct.cpName" label="产品名称"></el-table-column>
            <el-table-column prop="cpProduct.cpType" label="产品型号"></el-table-column>
          </el-table>
        </el-main>
      </el-container>
    </el-dialog>
    <!-- 用户管理弹框 -->
    <el-dialog title="选择负责人" :visible.sync="userSelect" width="30%">
      <el-container>
        <el-main>
          <!-- 展示用户信息信息 -->
          <el-table border :data="userList" @row-dblclick="updateUser">
            <el-table-column prop="userName" label="人员名称" width="140px"></el-table-column>
            <el-table-column prop="dept.deptName" label="部门"></el-table-column>
            <el-table-column prop="sex" label="性别" :formatter="getSex"></el-table-column>
          </el-table>
        </el-main>
      </el-container>
    </el-dialog>
  </div>
</template>

<script>
import {
  listOrder,
  getOrder,
  delOrder,
  addOrder,
  updateOrder,
  listBom,
  getCpAttribute,
  updateGdStatus, updateNoStatus
} from "@/api/order/order";
import {listForm} from "@/api/scdd/form";
import { listUser} from "@/api/system/user";

export default {
  name: "Order",
  dicts: ['wl_from', 'wl_type', 'wl_sortcode','jsdw_unit_type'],

  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 子表选中数据
      checkedScddProductionOrderForm: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      activeTab: 'bom',
      // 总条数
      total: 0,
      // 生产工单表格数据
      orderList: [],
      //产品属性集合
      attributesData:[],
      // 生产订单表格数据
      scddProductionOrderFormList: [],
      // 弹出层标题
      title: "",
      //订单信息
      scddList:[],
      //工序进度集合
      productionProgressData:[],
      //用户列表
      userList:[],
      //Bom列表
      bomData:[],
      //弹出选择用户
      userSelect:false,
      //用户分页
      userTotal:0,
      //用户姓名
      userName:null,
      //订单分页参数
      scddTotal:0,
      //生产订单号
      scddCode:null,
      //弹出选择订单
      ddSelect:false,
      //订单详情标题
      scgdTitle:"工单详情",
      //展示详情
      scgdSelected:false,
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        gdGoodlevel: null,
        gdStatus: null,
        ddCode: null,
        htCode: null,
        cpCode: null,
        ksCode: null,
        workNum: null,
        jhTime: null,
        startTime: null,
        endTime: null,
        other: null,
        isUse: null,
        isDelete: null,
        percent: null,
        scgdCreate: null,
        createTime: null,
        updateTime: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        gdGoodlevel: [
          { required: true, message: "工单优先级不能为空", trigger: "blur" }
        ],
        gdStatus: [
          { required: true, message: "工单状态不能为空", trigger: "change" }
        ],
        ddCode: [
          { required: true, message: "订单号不能为空", trigger: "blur" }
        ],
        htCode: [
          { required: true, message: "合同编号不能为空", trigger: "blur" }
        ],
        cpCode:[
          { required: true, message: "产品编码不能为空", trigger: "blur" }
        ],
        'cpProduct.cpName': [
          { required: true, message: "产品名称不能为空", trigger: "blur" }
        ],
        'cpProduct.cpType':[
          { required: true, message: "产品型号不能为空", trigger: "blur" }
        ],
        ksCode: [
          { required: true, message: "工单客户不能为空", trigger: "blur" }
        ],
        responsibility:[
          { required: true, message: "负责人不能为空", trigger: "blur" }
        ],
        workNum: [
          { required: true, message: "任务数量不能为空", trigger: "blur" }
        ],
        jhTime: [
          { required: true, message: "交货日期不能为空", trigger: "blur" }
        ],
        startTime: [
          { required: true, message: "计划开始时间不能为空", trigger: "blur" }
        ],
        endTime: [
          { required: true, message: "计划完成时间不能为空", trigger: "blur" }
        ],


      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询生产工单列表 */
    getList() {
      this.reset();
      this.loading = true;
      listOrder(this.queryParams).then(response => {
        this.orderList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    /**展示详情*/
    scgdBtn(){
      this.scgdSelected=false;
    },
    /**查询用户列表*/
    getUsers(){
      this.userSelect=true;
      listUser(this.userName).then(response => {
        this.userList = response.rows;
        this.userTotal = response.total;
        console.log(response.rows)
      });
    },
    /**判断性别*/
    getSex(row, column, cellValue){
      if (cellValue=="1"){
        return "女";
      }else{
        return "男";
      }
    },
    //订单性质
    orderAbility(row, column, cellValue){
      if (cellValue=='1'){
        return "销售";
      }else if(cellValue=='2'){
        return "样品";
      }else{
        return "研发";
      }
    },
    //优先级
    gdLevel(row, column, cellValue){
      if (cellValue=="1"){
        return "一级";
      }else{
        return  "二级";
      }
    },
    //查询生产订单
    getScdd(){
      this.ddSelect=true;
      listForm(this.scddCode).then(response => {
        this.scddList = response.rows;
        console.log(this.scddList)
        this.scddTotal = response.total;
      });
    },

    //工单状态
    gdStatus(row, column, cellValue){
      if (cellValue=="1"){
        return "生产中";
      }else if(cellValue=="2"){
        return  "未投产";
      }else if(cellValue=="3"){
        return "已投产";
      }else if(cellValue=="4"){
        return "暂停中";
      }else if(cellValue=="5"){
        return "已完工";
      }
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    /**  工单撤回投产 */
    updateGdNoStatus(row,gdStatus){
      let status='';
      if (gdStatus=='撤回'){
        status='2';
      }else{
        status="3";
      }
      const gdCode=row.gdCode;
      this.$modal.confirm('是否确认'+gdStatus+'编号为"' + gdCode + '"的生产工单？').then(function() {
        return updateGdStatus(gdCode,status);
      }).then(()=>{
        this.$modal.msgSuccess(gdStatus+"成功");
        this.getList();
      })
    },
    /**选择订单*/
    updateScdd(row,column){
      this.form.scddProductionOrderForm=row;
      this.form.cpCode=row.cpCode;
      this.form.htCode=row.htCode;
      this.form.ksCode=row.ksCode;
      this.form.ddCode=row.ddCode;
      this.ddSelect=false;
      this.$refs.form.validateField('ddCode');
    },
    /**选择负责人*/
    updateUser(row,column){
      this.form.responsibility=row.userName;
      this.userSelect=false;
      this.$refs.form.validateField('responsibility');
      console.log(this.form);
    },
    /**查询工单关联的Bom*/
    getGdBom(){},
    /**重置表单*/
    reset() {
      this.form = {
        gdCode: null,
        gdGoodlevel: null,
        gdStatus: 2,
        ddCode: null,
        htCode: null,
        cpCode: null,
        scddProductionOrderForm:{cpProduct:{cpName:null,cpType:null,cpCode:null},ksMerchant:{merchantsName:null},ddCode:null,htCode:null},
        responsibility:null,
        ksCode: null,
        workNum: null,
        jhTime: null,
        gdCppcCode:null,
        startTime: null,
        endTime: null,
        other: null,
        isUse: 1,
        isDelete: 1,
        percent: 0,
        scgdCreate: 'admin',
        createTime: Date.now(),
        updateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.gdCode)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加生产工单";
    },
    //订单类型
    orderType(row, column, cellValue){
      if (cellValue=="1"){
        return "普通订单";
      }else if(cellValue=="2"){
        return "OEM订单";
      }else{
        return "在库订单";
      }
    },
    /** 编辑按钮操作 */
    handleUpdates(row){
      this.reset();
      const gdCode = row.gdCode || this.ids
      getOrder(gdCode).then(response => {
        this.form = response.data;
        this.form.gdCode=row.gdCode;
        this.open = true;
        this.title = "修改生产工单";
      })
    },
    /** 详情按钮操作 */
    handleUpdate(row) {
      this.reset();
      const gdCode = row.gdCode || this.ids
      getOrder(gdCode).then(response => {
        this.form = response.data;
        this.form.gdCode=row.gdCode;
        this.scgdSelected = true;
        this.title = "修改生产工单";
      }).then(()=>{
        listBom(gdCode).then(response=>{
          console.log(gdCode)
          this.bomData=response.data;
          console.log(this.bomData);
        })
      }).then(()=>{
        const cpCode=row.cpCode;
        getCpAttribute(cpCode).then(response=>{
          console.log(response.data);
          this.attributesData=response.data;
        })
      })
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.gdCode != null) {
            console.log("进入了修改=========")
            updateOrder(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            console.log("进入了新增=========")
            addOrder(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const gdCodes = row.gdCode || this.ids;
      this.$modal.confirm('是否确认删除生产工单编号为"' + gdCodes + '"的数据项？').then(function() {
        return delOrder(gdCodes);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
	/** 生产订单序号 */
    rowScddProductionOrderFormIndex({ row, rowIndex }) {
      row.index = rowIndex + 1;
    },
    /** 生产订单添加按钮操作 */
    handleAddScddProductionOrderForm() {
      let obj = {};
      obj.ddLevel = "";
      obj.ddStatus = "";
      obj.ddTypecode = "";
      obj.ddGoodcode = "";
      obj.ksCode = "";
      obj.htCode = "";
      obj.cpCode = "";
      obj.ddNum = "";
      obj.jhDate = "";
      obj.startTime = "";
      obj.finishTime = "";
      obj.other = "";
      obj.isUse = "";
      obj.isDelete = "";
      obj.scddCreate = "";
      obj.createTime = "";
      obj.updateTime = "";
      this.scddProductionOrderFormList.push(obj);
    },
    /** 生产订单删除按钮操作 */
    handleDeleteScddProductionOrderForm() {
      if (this.checkedScddProductionOrderForm.length == 0) {
        this.$modal.msgError("请先选择要删除的生产订单数据");
      } else {
        const scddProductionOrderFormList = this.scddProductionOrderFormList;
        const checkedScddProductionOrderForm = this.checkedScddProductionOrderForm;
        this.scddProductionOrderFormList = scddProductionOrderFormList.filter(function(item) {
          return checkedScddProductionOrderForm.indexOf(item.index) == -1
        });
      }
    },
    /** 复选框选中数据 */
    handleScddProductionOrderFormSelectionChange(selection) {
      this.checkedScddProductionOrderForm = selection.map(item => item.index)
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/order/export', {
        ...this.queryParams
      }, `order_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
<style>
.el-date-editor.el-input, .el-date-editor.el-input__inner{
  width: 202px;

}
.qyhH input.el-input__inner{
  width:202px;
}
#other{
  width: 252%;
  height: 80px;
}
.dialog-content {
  max-height: 600px; /* 根据需要调整 */
  overflow-y: auto;
  padding-right: 15px; /* 为了避免滚动条覆盖内容 */
}
.dialog-footer {
  text-align: right;
}
</style>
